var  insertionS = 0;
var  insertionE = 0;
var  activeEl = "doc";// 0 - input  1 - textararea
var lastpos = 0
var lastpospre = 0;
var punctwords = new Array();
var punctchars = new Array();

punctwords[punctwords.length] = "точка"; punctchars[punctchars.length] = ".";
punctwords[punctwords.length] = " ."; punctchars[punctchars.length] = ".";
punctwords[punctwords.length] = "запятая"; punctchars[punctchars.length] = ",";
punctwords[punctwords.length] = " ,"; punctchars[punctchars.length] = ",";
punctwords[punctwords.length] = "точка запятой"; punctchars[punctchars.length] = ";";
punctwords[punctwords.length] = " ;"; punctchars[punctchars.length] = ";";
punctwords[punctwords.length] = "двоеточие"; punctchars[punctchars.length] = ":";
punctwords[punctwords.length] = " :"; punctchars[punctchars.length] = ":";
punctwords[punctwords.length] = "смайл"; punctchars[punctchars.length] = ":)";
punctwords[punctwords.length] = " :)"; punctchars[punctchars.length] = ":)";
punctwords[punctwords.length] = "кавычки "; punctchars[punctchars.length] = "\"";
punctwords[punctwords.length] = "кавычки"; punctchars[punctchars.length] = "\"";
punctwords[punctwords.length] = " кавычки"; punctchars[punctchars.length] = "\"";
punctwords[punctwords.length] = " \" "; punctchars[punctchars.length] = "\" ";
punctwords[punctwords.length] = "восклицательный знак"; punctchars[punctchars.length] = "!";
punctwords[punctwords.length] = " !"; punctchars[punctchars.length] = "!";
punctwords[punctwords.length] = "вопросительный знак"; punctchars[punctchars.length] = "?";
punctwords[punctwords.length] = " ?"; punctchars[punctchars.length] = "?";
punctwords[punctwords.length] = "звездочка"; punctchars[punctchars.length] = "*";
punctwords[punctwords.length] = " *"; punctchars[punctchars.length] = "*";
punctwords[punctwords.length] = "новая строка"; punctchars[punctchars.length] = "\n";
punctwords[punctwords.length] = " \n "; punctchars[punctchars.length] = "\n";
punctwords[punctwords.length] = "\n "; punctchars[punctchars.length] = "\n";
punctwords[punctwords.length] = "люблю"; punctchars[punctchars.length] = "♥";
punctwords[punctwords.length] = " ♥"; punctchars[punctchars.length] = "♥";
punctwords[punctwords.length] = "dot"; punctchars[punctchars.length] = ".";
punctwords[punctwords.length] = " ."; punctchars[punctchars.length] = ".";
punctwords[punctwords.length] = "comma"; punctchars[punctchars.length] = ",";
punctwords[punctwords.length] = " ,"; punctchars[punctchars.length] = ",";
punctwords[punctwords.length] = "semicolon"; punctchars[punctchars.length] = ";";
punctwords[punctwords.length] = " ;"; punctchars[punctchars.length] = ";";
punctwords[punctwords.length] = "colon"; punctchars[punctchars.length] = ":";
punctwords[punctwords.length] = " :"; punctchars[punctchars.length] = ":";
punctwords[punctwords.length] = "smile"; punctchars[punctchars.length] = ":)";
punctwords[punctwords.length] = " :)"; punctchars[punctchars.length] = ":)";
punctwords[punctwords.length] = "quotes "; punctchars[punctchars.length] = "\"";
punctwords[punctwords.length] = "quotes"; punctchars[punctchars.length] = "\"";
punctwords[punctwords.length] = " quotes"; punctchars[punctchars.length] = "\"";
punctwords[punctwords.length] = " \" "; punctchars[punctchars.length] = "\" ";
punctwords[punctwords.length] = "exclamation mark"; punctchars[punctchars.length] = "!";
punctwords[punctwords.length] = " !"; punctchars[punctchars.length] = "!";
punctwords[punctwords.length] = "question mark"; punctchars[punctchars.length] = "?";
punctwords[punctwords.length] = " ?"; punctchars[punctchars.length] = "?";
punctwords[punctwords.length] = "asterisk"; punctchars[punctchars.length] = "*";
punctwords[punctwords.length] = " *"; punctchars[punctchars.length] = "*";
punctwords[punctwords.length] = "new line"; punctchars[punctchars.length] = "\n";
punctwords[punctwords.length] = " \n "; punctchars[punctchars.length] = "\n";
punctwords[punctwords.length] = "\n "; punctchars[punctchars.length] = "\n";
punctwords[punctwords.length] = "love"; punctchars[punctchars.length] = "♥";
punctwords[punctwords.length] = " ♥"; punctchars[punctchars.length] = "♥";
